const sendPage = require ("../controller/pageController");

module.exports = {
    //发送页面
    pageRouter: function(req, res) {
        let url = req.url.split(".");
    
        if (url[1] == "html" || url[1] == "css" || url[1] == "js") {
            //router--->controller
            sendPage.sendHtml(req, res);
        }
        if (url[1] == "JPG" || url[1] == "jpeg" || url[1] == "png" || url[1] == "gif") {
            sendPage.sendImage(req, res);
        }; 
    }
}